home *** CD-ROM | disk | FTP | other *** search
/ Power CD-ROM!! 8 / Power CD-ROM 8.iso / prgmming / noboot10 / sample / nbsample.frm (.txt) next >
Encoding:
Visual Basic Form  |  1994-10-09  |  3.5 KB  |  114 lines

  1. VERSION 2.00
  2. Begin Form NBSample 
  3.    AutoRedraw      =   -1  'True
  4.    BackColor       =   &H00000000&
  5.    BorderStyle     =   0  'None
  6.    Caption         =   "No Boot Sample"
  7.    ClientHeight    =   2025
  8.    ClientLeft      =   2280
  9.    ClientTop       =   2625
  10.    ClientWidth     =   6465
  11.    Height          =   2430
  12.    Left            =   2220
  13.    LinkTopic       =   "Form1"
  14.    ScaleHeight     =   2025
  15.    ScaleWidth      =   6465
  16.    Top             =   2280
  17.    Width           =   6585
  18.    Begin MabryNoBoot NoBoot1 
  19.       Height          =   420
  20.       Left            =   600
  21.       Top             =   1440
  22.       Width           =   420
  23.    End
  24.    Begin Timer Timer1 
  25.       Enabled         =   0   'False
  26.       Interval        =   1
  27.       Left            =   120
  28.       Top             =   1440
  29.    End
  30.    Begin Label Label2 
  31.       AutoSize        =   -1  'True
  32.       BackColor       =   &H00000000&
  33.       Caption         =   "While this sample is running, try to use Ctrl-Alt-Del.  You can exit this sample by pressing the Space bar."
  34.       ForeColor       =   &H00FFFFFF&
  35.       Height          =   195
  36.       Left            =   120
  37.       TabIndex        =   1
  38.       Top             =   120
  39.       Width           =   8865
  40.    End
  41.    Begin Label Label1 
  42.       AutoSize        =   -1  'True
  43.       BackColor       =   &H00000000&
  44.       Caption         =   "Mabry Software.  Software nuts and bolts -- no screws."
  45.       FontBold        =   -1  'True
  46.       FontItalic      =   0   'False
  47.       FontName        =   "MS Sans Serif"
  48.       FontSize        =   13.5
  49.       FontStrikethru  =   0   'False
  50.       FontUnderline   =   0   'False
  51.       ForeColor       =   &H0000C000&
  52.       Height          =   360
  53.       Left            =   240
  54.       TabIndex        =   0
  55.       Top             =   840
  56.       Width           =   7575
  57.    End
  58. Option Explicit
  59. Declare Function ShowCursor Lib "User" (ByVal bShow As Integer) As Integer
  60. Dim CursorCount As Integer
  61. Dim QuitFlag As Integer
  62. Sub Form_KeyDown (KeyCode As Integer, Shift As Integer)
  63.     If KeyCode = Asc(" ") Then
  64.         QuitFlag = True
  65.     End If
  66. End Sub
  67. Sub Form_Load ()
  68.     NoBoot1 = False
  69.     Randomize
  70.     On Error Resume Next
  71.     If UCase(Command$) <> "/S" Or App.PrevInstance Then End
  72.     If UCase(Command$) = "/C" Then
  73.         MsgBox "This screen saver has no options.", 64, "NoBoot Sample Saver"
  74.         End
  75.     End If
  76.     QuitFlag% = False
  77.     CursorCount = ShowCursor(False) + 1
  78.     Do While ShowCursor(False) >= -1
  79.     Loop
  80.     Do While ShowCursor(True) < -1
  81.     Loop
  82.     NBSample.Move 0, 0, Screen.Width, Screen.Height
  83.     DoEvents
  84.     Me.Show
  85.     timer1.Enabled = True
  86. End Sub
  87. Sub Form_Unload (Cancel As Integer)
  88.     NoBoot1 = True
  89.     Unload NBSample
  90.     ' reset cursor to its old state
  91.     Do While ShowCursor(False) >= CursorCount
  92.     Loop
  93.     Do While ShowCursor(True) < CursorCount
  94.     Loop
  95.     End
  96. End Sub
  97. Sub Timer1_Timer ()
  98.     Static xLast
  99.     If QuitFlag = True Then Unload NBSample
  100.     If xLast = 0 Then
  101.         xLast = NBSample.Width
  102.         Label1.Top = ((NBSample.Height - Label1.Height) * Rnd)
  103.     Else
  104.         xLast = xLast - NBSample.TextWidth(" ")
  105.         If xLast = 0 Then
  106.             xLast = -1
  107.         ElseIf xLast + Label1.Width < 0 Then
  108.             xLast = NBSample.Width
  109.             Label1.Top = ((NBSample.Height - Label1.Height) * Rnd)
  110.         End If
  111.     End If
  112.     Label1.Left = xLast
  113. End Sub
  114.